package com.qing.demo.netty.domain;

/**
 * @author caozhipeng
 * @date 2025/8/7
 */
public class EasyResult {

    private boolean success;

    private String title;

    private String msg;

    public static EasyResult buildSuccessResult(){
        EasyResult easyResult=new EasyResult();
        easyResult.setSuccess(true);
        easyResult.setMsg("操作成功");
        return easyResult;
    }

    public static EasyResult buildErrorResult(Exception ex){
        EasyResult easyResult=new EasyResult();
        easyResult.setSuccess(false);
        easyResult.setMsg(easyResult.getMsg());
        return easyResult;
    }

    public static EasyResult buildErrorResult(String msg){
        EasyResult easyResult=new EasyResult();
        easyResult.setSuccess(false);
        easyResult.setMsg(msg);
        return easyResult;
    }


    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
